var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var UI_MosterLogic_UIBindings = require("AA_UI_MosterLogic_UIBindings");
var ResKeeper = require("AA_ResKeeper");
var EventManager = require("AA_EventManager");
var EvenType = require("AA_EvenType");
var NodePoolMag = require("AA_NodePoolMag");
var Excel = require("AA_Excel");
var BuffMag = require("AA_BuffMag");
var BundleConfig = require("AA_BundleConfig");
var UI_HuDun = require("AA_UI_HuDun");
var UI_MosterXueTiao = require("AA_UI_MosterXueTiao");
var LogManager = require("AA_LogManager");
var GameDataManager = require("AA_GameDataManager");
var GameGlobalVariable = require("AA_GameGlobalVariable");
var AudioManager = require("AA_AudioManager");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_MosterLogic = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    t.mosterId = 1;
    t.hunmoNode = null;
    t.mosterXueTiao = null;
    t.xueliang = 0;
    t.maxxueliang = 0;
    t.mosterspeed = 0;
    t.defy = 999999;
    t.liuxueContentNode = null;
    t.zhengshangNode = null;
    t.shanbaiNode = null;
    t.nowmosterdata = null;
    t.paths = null;
    t.nowtexindex = 0;
    t.twmove = null;
    t.nowHuDunNode = null;
    t.iszhaohuan = false;
    t.zhaohuantime = 100;
    t.isXiGuaBomb = false;
    t.isDie = false;
    t.isback = false;
    t.overback = false;
    t.ohterbullet = null;
    t.shanbaitw = null;
    t.isputong = false;
    t.putongjianshu = 0;
    t.zhongduNode = null;
    t.bingdongNode = null;
    t.dongjieNode = null;
    t.liuxueNode = null;
    t.bingdongjianshu = 0;
    t.isjianshu = false;
    t.jianshutime = 0;
    t.isdongjie = false;
    t.dongjietime = 0;
    t.iszhongdu = false;
    t.dushan = 0;
    t.zhongdutime = 0;
    t.isliuxue = false;
    t.liuxueshang = 0;
    t.liuxuetime = 0;
    t.isransao = false;
    t.ransaoshang = 0;
    t.ransaotime = 0;
    t.diejiacount = 0;
    t.dushangplayer = null;
    t.fanweidong = false;
    t.nowbuffatackplay = null;
    t.ismove = false;
    t.moveindex = 0;
    t.tesofftime = 0;
    t.dutimeleiji = 0;
    t.liutimeleiji = 0;
    t.ransaotimeleiji = 0;
    t.jiansuleiji = 0;
    t.dongjieleiji = 0;
    t.zhaohuantimeleiji = 0;
    t.nowmosterskillid = [];
    t.jiasuleitime = 0;
    t.jiasucode = 1;
    t.jiasutime = 4;
    t.jiasuweicitime = 2;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    this.fanweidong = false;
    this.shanbaitw && this.shanbaitw.stop();
    this.shanbaiNode = this.node.children[0].getChildByName("item").children[0];
    this.shanbaiNode.opacity = 0;
    this.node.children.forEach(function (e) {
      e.active = true;
    });
    if (999999 != this.defy) {
      this.hunmoNode.y = this.defy;
    } else {
      this.defy = this.hunmoNode.y;
    }
    this.hunmoNode.active = false;
    this.node.getChildByName("dongImg").active = false;
    this.liuxueContentNode = this.node.getChildByName("liuxueNode");
    this.zhengshangNode = this.node.getChildByName("zhengshang");
    this.zhengshangNode.active = false;
  };
  _creator.prototype.onDisable = function () {
    if (this.nowHuDunNode) {
      NodePoolMag.NodePoolMag.instance.recycleNode("hudun", this.nowHuDunNode);
      this.nowHuDunNode = null;
    }
    this.fanweidong = false;
    BuffMag.BuffMgr.cleanMosterBombCount(this);
    this.cleanDuEff();
    this.cleanBingEff();
    this.cleanDongjieEff();
    this.cleanLiuXueEff();
    this.cleanXiGuaBomb();
    this.unscheduleAllCallbacks();
  };
  _creator.prototype.setIsXiGuaBomb = function () {
    return __awaiter(this, undefined, undefined, function () {
      return __generator(this, function () {
        if (!(this.isXiGuaBomb || this.isDie)) {
          this.isXiGuaBomb = true;
          this.zhengshangNode.active = true;
        }
        return [2];
      });
    });
  };
  _creator.prototype.cleanXiGuaBomb = function () {
    this.zhengshangNode.active = false;
  };
  _creator.prototype.setMosterInfo = function (e, t, o, n, i) {
    undefined === i && (i = 1);
    return __awaiter(this, undefined, undefined, function () {
      var a;
      var r;
      var c;
      var u;
      var l;
      var d;
      var p;
      var g;
      var _;
      var m;
      return __generator(this, function () {
        this.isDie = false;
        this.isXiGuaBomb = false;
        this.nowtexindex = o;
        a = Excel.Excel.shuiguoguaiwu(e);
        this.nowmosterdata = a;
        this.mosterspeed = this.nowmosterdata.mosterspeed / 60;
        this.xueliang = this.nowmosterdata.mosterxue;
        r = 1;
        if (1 == GameGlobalVariable.GameGlobalVariable.isTeShuLevel()) {
          c = GameDataManager.GameDataMgr.getNowMaxLevel();
          u = Excel.Excel.shuiguoguanqia(c);
          l = u.levelboshuid[u.levelboshuid.length - 1];
          d = Excel.Excel.shuiguoboshu(l);
          r = d.mosterjiaxue;
        }
        n && (this.xueliang = this.nowmosterdata.mosterxue * n.mosterjiaxue * r);
        this.maxxueliang = this.xueliang;
        this.mosterXueTiao.initXue(this.maxxueliang);
        this.moveindex = i;
        this.paths = t;
        this.updateXueTiao();
        this.ismove = true;
        this.node.opacity = 0;
        cc.tween(this.node).to(.1, {
          opacity: 255
        }).start();
        p = this.auto_ui.node_piaozipos.children;
        g = p.length;
        for (_ = 0; _ < g; _++) {
          m = p[0];
          NodePoolMag.NodePoolMag.instance.recycleNode("piaozi", m);
        }
        this.twmove = cc.tween(this.node.children[0]).to(.25, {
          scaleY: .9
        }).to(.25, {
          scaleY: 1
        });
        cc.tween(this.node.children[0]).repeatForever(this.twmove).start();
        this.overback = false;
        return [2];
      });
    });
  };
  _creator.prototype.addHuDun = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      return __generator(this, function (t) {
        switch (t.label) {
          case 0:
            this.nowHuDunNode = NodePoolMag.NodePoolMag.instance.getNode("hudun");
            if (this.nowHuDunNode) {
              return [3, 2];
            } else {
              return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_HuDun", cc.Prefab)];
            }
          case 1:
            e = t.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("hudun", 1, e);
            this.nowHuDunNode = NodePoolMag.NodePoolMag.instance.getNode("hudun");
            t.label = 2;
          case 2:
            this.auto_ui.node_hudunnode.addChild(this.nowHuDunNode);
            this.nowHuDunNode.getComponent(UI_HuDun.default).initHuDu(100);
            this.iszhaohuan = false;
            return [2];
        }
      });
    });
  };
  _creator.prototype.updateXueTiao = function () {
    this.xueliang <= 0 && this.isDieMoster();
  };
  _creator.prototype.isDieMoster = function (e) {
    var t = this;
    undefined === e && (e = 1);
    if (!this.isDie) {
      BuffMag.BuffMgr.cleanMosterDieJia(this);
      BuffMag.BuffMgr.cleanMosterBomb(this.node.uuid);
      var o = BuffMag.BuffMgr.getDuWu();
      this.iszhongdu && o && EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_CreateDuWu, this, o, this.dushangplayer);
      this.ohterbullet && this.ohterbullet.attackfang && BuffMag.BuffMgr.setBombShanHai(this.ohterbullet.attackfang, this);
      this.node.children.forEach(function (e) {
        e.active = false;
      });
      this.hunmoNode.active = true;
      this.hunmoNode.opacity = 255;
      cc.tween(this.hunmoNode).to(.5, {
        y: this.hunmoNode.y + 100
      }).to(.1, {
        opacity: 0
      }).call(function () {
        t.node.stopAllActions();
        t.unscheduleAllCallbacks();
        t.resetState();
        NodePoolMag.NodePoolMag.instance.recycleNode("moster_" + t.mosterId, t.node);
      }).start();
      this.isDie = true;
      this.ismove = false;
      1 == e && EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_Moster_DIE, {
        moster: this.mosterId
      });
    }
  };
  _creator.prototype.moveBu = function () {
    if (this.ismove) {
      var e = this.paths.children[this.moveindex];
      if (!e) {
        this.isDieMoster(2);
        return void EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_Moster_Attack, {
          mosterId: this.mosterId
        });
      }
      var t = e.x;
      var o = e.y;
      if (0 == this.moveindex) {
        this.node.x = t;
        this.node.y = o;
        this.moveindex += 1;
      } else {
        var n = cc.Vec2.subtract(cc.v2(), cc.v2(t, o), this.node.getPosition());
        var i = Math.atan2(n.y, n.x);
        var a = cc.Vec2.distance(this.node.getPosition(), cc.v2(t, o));
        this.node.x += Math.cos(i) * this.nowspeed();
        this.node.y += Math.sin(i) * this.nowspeed();
        a < 5 && (this.moveindex += 1);
      }
    }
  };
  _creator.prototype.getNowMosterNode = function (e) {
    var t = this.node.parent.children;
    var o = [];
    for (var n = 0; n < t.length; n++) {
      var i = t[n];
      var a = cc.Vec2.distance(i.getPosition(), this.node.getPosition());
      (a -= i.width / 2 + this.node.width / 2) <= e && o.push(i);
    }
    return o;
  };
  _creator.prototype.addBaoHe = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      var t;
      return __generator(this, function (o) {
        switch (o.label) {
          case 0:
            if (e = NodePoolMag.NodePoolMag.instance.getNode("baohe")) {
              return [3, 2];
            } else {
              return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_BaoHe", cc.Prefab)];
            }
          case 1:
            t = o.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("baohe", 1, t);
            e = NodePoolMag.NodePoolMag.instance.getNode("baohe");
            o.label = 2;
          case 2:
            e.x = this.node.x;
            e.y = this.node.y + this.node.height / 2;
            GameGlobalVariable.GameGlobalVariable.effNode.addChild(e);
            return [2];
        }
      });
    });
  };
  _creator.prototype.backStart = function () {
    var e = this;
    if (!this.isback && !this.isDie && 5 != this.moveindex) {
      this.addBaoHe();
      this.ismove = false;
      this.isback = true;
      this.moveindex = 0;
      this.overback = true;
      var t = this.paths.children[this.moveindex];
      cc.tween(this.node).to(1, {
        x: t.x,
        y: t.y
      }).call(function () {
        e.isback = false;
        e.ismove = true;
      }).start();
    }
  };
  _creator.prototype.backTui = function (e) {
    var t = this;
    if (this.moveindex >= 2) {
      this.ismove = false;
      var o = this.moveindex - 1;
      o < 0 && (o = 0);
      (function e(o, n) {
        var i = t.paths.children[n];
        if (i) {
          var a = i.x;
          var r = i.y;
          var c = cc.Vec2.distance(t.node.getPosition(), cc.v2(a, r));
          var s = 0;
          if (o > c) {
            s = o - c;
            o = c;
          }
          var u = cc.Vec2.subtract(cc.v2(), cc.v2(a, r), t.node.getPosition());
          var l = Math.atan2(u.y, u.x);
          var d = t.node.x + Math.cos(l) * o;
          var p = t.node.y + Math.sin(l) * o;
          cc.tween(t.node).to(.1, {
            x: d,
            y: p
          }).call(function () {
            if (s > 0) {
              e(s, n -= 1);
            } else {
              t.moveindex = n + 1;
              t.scheduleOnce(function () {
                t.ismove = true;
              }, .1);
            }
          }).start();
        } else {
          t.moveindex = n + 1;
        }
      })(e, o);
    }
  };
  _creator.prototype.addBiSha = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      var t;
      var o;
      return __generator(this, function (n) {
        switch (n.label) {
          case 0:
            if (e = NodePoolMag.NodePoolMag.instance.getNode("bisha")) {
              return [3, 2];
            } else {
              return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_BiSha", cc.Prefab)];
            }
          case 1:
            t = n.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("bisha", 1, t);
            e = NodePoolMag.NodePoolMag.instance.getNode("bisha");
            n.label = 2;
          case 2:
            o = this.node.convertToWorldSpaceAR(cc.v2());
            o = GameGlobalVariable.GameGlobalVariable.effNode.convertToNodeSpaceAR(o);
            e.x = o.x;
            e.y = o.y;
            GameGlobalVariable.GameGlobalVariable.effNode.addChild(e);
            return [2];
        }
      });
    });
  };
  _creator.prototype.beAttack = function (e, t) {
    undefined === t && (t = false);
    if (!this.isDie) {
      this.ohterbullet = e;
      if (e.getBiSha(this.xueliang / this.maxxueliang) && -1 == this.nowmosterdata.boss) {
        this.jianxue(this.xueliang, 4, e.attackfang);
        return void this.addBiSha();
      }
      var o = e.getBulletAttack(this);
      var n = BuffMag.BuffMgr.addPlayerAttack(this, e.attackfang);
      var i = BuffMag.BuffMgr.getMosterBombJiaCheng(this);
      var a = 0;
      2 == e.bulletId && (a = BuffMag.BuffMgr.getMosterBombCountHangHai(this));
      var r = 0;
      this.isXiGuaBomb && (r = BuffMag.BuffMgr.getMosterBombZengShang());
      o += o * (n + i + a + r);
      o += BuffMag.BuffMgr.getAttackGuding(e.attackfang);
      this.playBeHitEff();
      var c = 1;
      e.isbaoji && (c = 2);
      (2 == e.bulletId || t) && (c = 5);
      this.jianxue(o, c, e.attackfang);
    }
  };
  _creator.prototype.jianxue = function (e, t, o) {
    if (this.nowHuDunNode) {
      var n = this.nowHuDunNode.getComponent(UI_HuDun.default);
      n.subXueLiang(e);
      n.xuelinag < 0 && (this.nowHuDunNode = null);
    } else {
      e = BuffMag.BuffMgr.getMosterAllShangHai(e);
      this.mosterXueTiao.subXue(e);
      this.xueliang -= e;
      this.updateXueTiao();
    }
    var i = this.auto_ui.node_piaozipos;
    o && o.playerId && GameGlobalVariable.GameGlobalVariable.jiluAttack(o.playerId, e);
    EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_ShangHai_FeiZi, e, i.convertToWorldSpaceAR(cc.v2()), null, t);
  };
  _creator.prototype.fujiaAttack = function (e, t, o) {
    if (!this.isDie) {
      this.ohterbullet = o;
      this.playBeHitEff();
      this.jianxue(e, t, o);
    }
  };
  _creator.prototype.playBeHitEff = function () {
    var e = this;
    this.shanbaitw && this.shanbaitw.stop();
    this.shanbaitw = cc.tween(this.shanbaiNode).to(.05, {
      opacity: 255
    }).delay(.1).call(function () {
      e.shanbaiNode.opacity = 0;
    }).start();
  };
  _creator.prototype.nowspeed = function () {
    var e = 0;
    if (this.isdongjie) {
      e = 0;
    } else {
      var t = .3 * this.mosterspeed;
      var o = BuffMag.BuffMgr.getNowSpeedBiLi();
      t > (e = this.mosterspeed - this.mosterspeed * (this.bingdongjianshu + o + this.putongjianshu)) && (e = t);
    }
    return e * this.jiasucode;
  };
  _creator.prototype.resetState = function () {
    this.isjianshu = false;
    this.isdongjie = false;
    this.iszhongdu = false;
    this.isliuxue = false;
    this.isransao = false;
    this.dushan = 0;
    this.bingdongjianshu = 0;
    this.putongjianshu = 0;
    this.isputong = false;
    this.isback = false;
  };
  _creator.prototype.setPuTongJianShu = function (e) {
    if (!this.isputong) {
      this.isputong = true;
      this.putongjianshu = e.value[1] / 100;
      this.scheduleOnce(this.resetPuTongJianShu, e.value[2]);
    }
  };
  _creator.prototype.resetPuTongJianShu = function () {
    this.isputong = false;
    this.putongjianshu = 0;
  };
  _creator.prototype.setJianShu = function (e, t, o) {
    if (!(this.isjianshu && !BuffMag.BuffMgr.getDieJia(o))) {
      this.diejiacount += 1;
      this.diejiacount >= 3 && (this.diejiacount = 3);
      this.unschedule(this.resetValueBingDong);
      this.addBingEff();
      this.isjianshu = true;
      this.bingdongjianshu = e / 100 * this.diejiacount;
      this.scheduleOnce(this.resetValueBingDong, t);
      this.setDongImg(true, this.diejiacount);
      LogManager.LogMgr.debug("冰冻减速效益", this.bingdongjianshu);
    }
  };
  _creator.prototype.addDuEff = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      return __generator(this, function (t) {
        switch (t.label) {
          case 0:
            if (this.zhongduNode) {
              return [3, 3];
            } else {
              this.zhongduNode = NodePoolMag.NodePoolMag.instance.getNode("zhongdu");
              if (this.zhongduNode) {
                return [3, 2];
              } else {
                return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_ZhongDu", cc.Prefab)];
              }
            }
          case 1:
            e = t.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("zhongdu", 1, e);
            this.zhongduNode = NodePoolMag.NodePoolMag.instance.getNode("zhongdu");
            t.label = 2;
          case 2:
            this.zhongduNode.x = this.node.x;
            this.zhongduNode.y = this.node.y;
            GameGlobalVariable.GameGlobalVariable.effNode.addChild(this.zhongduNode);
            this.zhongduNode.opacity = 0;
            cc.tween(this.zhongduNode).to(.1, {
              opacity: 255
            }).start();
            this.isDie && this.cleanDuEff();
            t.label = 3;
          case 3:
            return [2];
        }
      });
    });
  };
  _creator.prototype.cleanDuEff = function () {
    if (this.zhongduNode) {
      NodePoolMag.NodePoolMag.instance.recycleNode("zhongdu", this.zhongduNode);
      this.zhongduNode = null;
    }
  };
  _creator.prototype.addBingEff = function () {
    return __awaiter(this, undefined, undefined, function () {
      return __generator(this, function () {
        return [2];
      });
    });
  };
  _creator.prototype.updateEff = function () {
    if (this.zhongduNode) {
      this.zhongduNode.x = this.node.x;
      this.zhongduNode.y = this.node.y;
    }
    if (this.dongjieNode) {
      this.dongjieNode.x = this.node.x;
      this.dongjieNode.y = this.node.y;
    }
  };
  _creator.prototype.cleanBingEff = function () {
    if (this.bingdongNode) {
      NodePoolMag.NodePoolMag.instance.recycleNode("bingshuang", this.bingdongNode);
      this.bingdongNode = null;
    }
  };
  _creator.prototype.addDongjieEff = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      return __generator(this, function (t) {
        switch (t.label) {
          case 0:
            if (this.isdongjie) {
              return [2];
            } else {
              AudioManager.AudioMgr.playEffect("game/sound/冻结", false, BundleConfig.BundleNames.Game);
              this.dongjieNode = NodePoolMag.NodePoolMag.instance.getNode("dongjie");
              if (this.dongjieNode) {
                return [3, 2];
              } else {
                return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_BingDong", cc.Prefab)];
              }
            }
          case 1:
            e = t.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("dongjie", 1, e);
            this.dongjieNode = NodePoolMag.NodePoolMag.instance.getNode("dongjie");
            t.label = 2;
          case 2:
            this.dongjieNode.x = 0;
            this.dongjieNode.y = 0;
            GameGlobalVariable.GameGlobalVariable.effNode.addChild(this.dongjieNode);
            return [2];
        }
      });
    });
  };
  _creator.prototype.cleanDongjieEff = function () {
    if (this.dongjieNode) {
      NodePoolMag.NodePoolMag.instance.recycleNode("dongjie", this.dongjieNode);
      this.dongjieNode = null;
    }
  };
  _creator.prototype.addLiuXueEff = function () {
    return __awaiter(this, undefined, undefined, function () {
      var e;
      return __generator(this, function (t) {
        switch (t.label) {
          case 0:
            if (this.isliuxue) {
              return [2];
            } else if (this.liuxueContentNode) {
              this.liuxueNode = NodePoolMag.NodePoolMag.instance.getNode("liuxue");
              if (this.liuxueNode) {
                return [3, 2];
              } else {
                return [4, this._loadRes(BundleConfig.BundleNames.Game, "game/" + "prefabs/effpre/UI_LiuXue", cc.Prefab)];
              }
            } else {
              return [3, 3];
            }
          case 1:
            e = t.sent();
            NodePoolMag.NodePoolMag.instance.createNodeCount("liuxue", 1, e);
            this.liuxueNode = NodePoolMag.NodePoolMag.instance.getNode("liuxue");
            t.label = 2;
          case 2:
            this.liuxueNode.x = 0;
            this.liuxueNode.y = 0;
            this.liuxueNode.width = this.liuxueContentNode.width;
            this.liuxueNode.height = this.liuxueContentNode.height;
            this.liuxueContentNode.addChild(this.liuxueNode);
            t.label = 3;
          case 3:
            return [2];
        }
      });
    });
  };
  _creator.prototype.cleanLiuXueEff = function () {
    if (this.liuxueNode) {
      NodePoolMag.NodePoolMag.instance.recycleNode("liuxue", this.liuxueNode);
      this.liuxueNode = null;
    }
  };
  _creator.prototype.setDongImg = function (e, t) {
    return __awaiter(this, undefined, undefined, function () {
      var o;
      return __generator(this, function (n) {
        switch (n.label) {
          case 0:
            if (this.isDie) {
              return [2];
            } else if (e) {
              GameGlobalVariable.GameGlobalVariable.playHitJianShu();
              this.node.getChildByName("dongImg").active = true;
              return [4, this._loadRes(BundleConfig.BundleNames.Common, "common/" + "res/moster/" + t, cc.SpriteFrame)];
            } else {
              return [3, 2];
            }
          case 1:
            o = n.sent();
            this.node.getChildByName("dongImg").getComponent(cc.Sprite).spriteFrame = o;
            return [3, 3];
          case 2:
            this.node.getChildByName("dongImg").active = false;
            n.label = 3;
          case 3:
            return [2];
        }
      });
    });
  };
  _creator.prototype.addDongJie = function (e) {
    this.fanweidong = true;
    this.isdongjie = true;
    this.dongjietime = e;
  };
  _creator.prototype.onSpeedJian = function (e, t) {
    this.nowbuffatackplay = t;
    switch (e.buffefftype) {
      case 2:
        var o = BuffMag.BuffMgr.getDieJia(t);
        if (!(this.isjianshu && !o)) {
          this.diejiacount += 1;
          this.diejiacount >= 3 && (this.diejiacount = 3);
          this.unschedule(this.resetValueBingDong);
          this.addBingEff();
          this.isjianshu = true;
          this.jianshutime = e.bufftime;
          this.bingdongjianshu = e.value[0] / 100 * this.diejiacount;
          this.scheduleOnce(this.resetValueBingDong, e.bufftime);
          this.setDongImg(true, this.diejiacount);
          LogManager.LogMgr.debug("冰冻减速效益", this.bingdongjianshu);
        }
        break;
      case 5:
        Excel.Excel.shuiguoguaiwu(this.mosterId);
        if (Math.random() <= e.probability / 100) {
          if (this.isdongjie) {
            return;
          }
          this.addDongjieEff();
          this.isdongjie = true;
          this.dongjietime = e.bufftime;
          LogManager.LogMgr.debug("冻结效益", this.isdongjie);
        }
        break;
      case 1:
        this.dushan = e.value[0] / 100;
        if (this.iszhongdu) {
          return;
        }
        this.addDuEff();
        this.dushangplayer = t;
        this.iszhongdu = true;
        this.zhongdutime = e.bufftime;
        break;
      case 22:
        if (this.isliuxue) {
          return;
        }
        this.addLiuXueEff();
        this.liuxueshang = e.value[0] + e.value[0] * BuffMag.BuffMgr.getLiuXueJiaCheng(t);
        this.isliuxue = true;
        this.liuxuetime = e.bufftime;
        break;
      case 24:
        if (this.isransao) {
          return;
        }
        this.ransaoshang = e.value[0];
        this.isransao = true;
        this.ransaotime = e.bufftime;
    }
  };
  _creator.prototype.resetValueBingDong = function () {
    this.bingdongjianshu = 0;
    this.isjianshu = false;
    this.diejiacount = 0;
    this.cleanBingEff();
    this.setDongImg(false, 0);
  };
  _creator.prototype.resetDongJie = function () {
    this.isdongjie = false;
    this.cleanDongjieEff();
  };
  _creator.prototype.zhongduXue = function () {
    var e = BuffMag.BuffMgr.getDuShang();
    var t = BuffMag.BuffMgr.playAttackJiaCheng(this.dushangplayer, this.dushangplayer.sgattack, 1) * this.dushan;
    e && (t += t * (e.value[0] / 100));
    this.jianxue(t, 3, this.nowbuffatackplay);
  };
  _creator.prototype.liuxueXue = function () {
    this.jianxue(this.liuxueshang, 1, this.nowbuffatackplay);
  };
  _creator.prototype.ranshaoXue = function () {
    this.jianxue(this.ransaoshang, 5, this.nowbuffatackplay);
  };
  _creator.prototype.isSkillType = function (e) {
    return -1 != this.nowmosterskillid.findIndex(function (t) {
      return t == e;
    });
  };
  _creator.prototype.onUpdate = function (e) {
    this.moveBu();
    if (this.isSkillType(1)) {
      if (1 == this.jiasucode) {
        this.jiasuleitime += e;
        this.jiasuleitime > this.jiasutime && (this.jiasucode = 2);
      } else {
        this.jiasuweicitime -= e;
        if (this.jiasuweicitime <= 0) {
          this.jiasucode = 1;
          this.jiasuleitime = 0;
        }
      }
    }
    this.updateEff();
    if (this.isransao) {
      this.ransaotimeleiji += e;
      if (this.ransaotimeleiji >= 1) {
        this.ranshaoXue();
        this.ransaotime -= 1;
        this.ransaotime <= 0 && (this.isransao = false);
        this.ransaotimeleiji = 0;
      }
    }
    if (this.iszhongdu) {
      this.dutimeleiji += e;
      if (this.dutimeleiji >= 1) {
        this.zhongduXue();
        this.zhongdutime -= 1;
        if (this.zhongdutime <= 0) {
          this.cleanDuEff();
          this.iszhongdu = false;
        }
        this.dutimeleiji = 0;
      }
    }
    if (this.isliuxue) {
      this.liutimeleiji += e;
      if (this.liutimeleiji >= 1) {
        this.liuxueXue();
        this.liuxuetime -= 1;
        if (this.liuxuetime <= 0) {
          this.cleanLiuXueEff();
          this.isliuxue = false;
        }
        this.liutimeleiji = 0;
      }
    }
    if (this.isdongjie) {
      this.dongjieleiji += e;
      if (this.dongjieleiji >= 1) {
        this.dongjietime -= 1;
        this.dongjietime <= 0 && this.resetDongJie();
        this.dongjieleiji = 0;
      }
    }
    if (this.iszhaohuan) {
      this.zhaohuantimeleiji += e;
      if (this.zhaohuantimeleiji >= 1) {
        EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_ZhaoHuan_Moster, this);
        this.zhaohuantimeleiji = 0;
      }
    }
  };
  __decorate([_property(UI_MosterLogic_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  __decorate([_property()], _creator.prototype, "mosterId", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "hunmoNode", undefined);
  __decorate([_property(UI_MosterXueTiao.default)], _creator.prototype, "mosterXueTiao", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_MosterLogic;